package cn.topevery.garden.dal.logic;

import cn.topevery.garden.dal.dao.CheckFileDao;
import cn.topevery.garden.entity.po.CheckFile;
import cn.topevery.garden.entity.query.CheckFileQuery;
import cn.topevery.garden.entity.vo.CheckFileVO;
import cn.topevery.garden.framework.base.BaseLogic;
import hw.topevery.framework.db.base.BaseEntityDao;
import hw.topevery.framework.db.entity.DataPager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 检查附件表
 *
 * @author code-generate
 * @date 2022-01-05
 */
@Service
public class CheckFileLogic extends BaseLogic<CheckFile> {
    @Autowired
    CheckFileDao checkFileDao;

    @Override
    public BaseEntityDao<CheckFile, Integer> getDao() {
        return checkFileDao;
    }

    

    /**
     * 获取列表
     *
     * @param query
     */
    public DataPager<CheckFileVO> listPage(CheckFileQuery query) {
        return checkFileDao.listPage(query);
    }

    /**
     * 根据自增id批量删除
     *
     * @param ids
     */
    public void deleteBatchById(String userId,Integer[] ids) {
        checkFileDao.delete(userId, ids);
    }

    /**
     * 根据自增id保存或者更新
     *
     * @param checkFile 实体
     */
    public void saveOrUpdate(String userId, CheckFile checkFile){
        checkFileDao.saveOrUpdate(userId,checkFile);
    }

    /**
         * 根据自定义列值来获取对象
         */
    public CheckFile getEntityByColumn(String key, String value) {
        return checkFileDao.getEntityByColumn(key, value);
    }
}
